package de.openkanban.server.domain;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

/**
 * 
 * @author msa
 * 
 */
@Entity
public class Kanban implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long kanbanId;

	private String title;
	private String description;
	private String effort;
	private Boolean pullable = true;

	@ManyToMany(fetch = FetchType.EAGER)
	private Set<User> kanbanUser = new HashSet<User>();

	public Kanban() {
	}

	public String getHistoryText() {
		return title + ("... " + description + "...");
	}

	public Long getKanbanId() {
		return kanbanId;
	}

	public void setKanbanId(Long kanbanId) {
		this.kanbanId = kanbanId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getEffort() {
		return effort;
	}

	public void setEffort(String effort) {
		this.effort = effort;
	}

	public Boolean getPullable() {
		return pullable;
	}

	public void setPullable(Boolean pullable) {
		this.pullable = pullable;
	}

	public Set<User> getKanbanUser() {
		return kanbanUser;
	}

	public void setKanbanUser(Set<User> kanbanUser) {
		this.kanbanUser = kanbanUser;
	}

}
